package com.panshi.controller;

import com.panshi.api.IQuestionAuditApi;
import com.panshi.vo.qa.DataResultQA;
import com.panshi.vo.qa.Pages;
import com.panshi.vo.qa.Question;
import com.panshi.vo.qa.QuestionAudit;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Controller
public class QuestionController {


    @Resource
    private IQuestionAuditApi qaApi;

    @GetMapping("/q-app/findQuestion")
    @ResponseBody
    public DataResultQA<Pages<QuestionAudit>> findQuestion(@RequestParam int page, @RequestParam int limit){
        Pages<Question> pages = new Pages();
        pages.setPageSize(limit);
        pages.setStartPage(page);
        pages.setState(1);
        return qaApi.inquirePagesQuestionAudit(pages);

    }

}
